import link from 'uni-simple-router/dist/link.vue';
import uView from 'uview-ui';
import Vue from 'vue';
import App from './App';
import { RouterMount, router } from './router';
import store from './store';

const { screenWidth } = uni.getSystemInfoSync();

Vue.config.productionTip = false;
Vue.use(router);
Vue.component('router-link', link);
Vue.prototype.$rootFontSize = `${(screenWidth / 375) * 16}px`;
Vue.use(uView);

uni.$u.setConfig({
  config: {
    unit: 'rpx',
  },
});

App.mpType = 'app';

const app = new Vue({
  store,
  ...App,
});

// #ifdef H5
RouterMount(app, router, '#app');
// #endif

// #ifndef H5
app.$mount();
// #endif
